from selenium.webdriver.common.by import By
from selenium import webdriver
import time
from selenium.webdriver.support.select import Select


driver=webdriver.Edge()
driver.get('https://www.jiuxian.com/')
# driver.maximize_window()
driver.find_element(By.CLASS_NAME,'headerLogin').click()
driver.find_element(By.ID,'userName').send_keys('13012558376')
driver.find_element(By.NAME,'_pwd').send_keys('123456Aa')
time.sleep(10)
driver.find_element(By.NAME,'bi_Usuallogin').click()
time.sleep(3)
driver.find_element(By.XPATH,'//*[@id="bindSub"]').click()
time.sleep(3)
dy1=driver.find_element(By.XPATH,'/html/body/div[2]/div/div[1]/div/p/span').text
print(dy1)
time.sleep(3)
driver.find_element(By.XPATH,'//a[@href="https://member.jiuxian.com/index.htm"]').click()
# 切换页面
driver.switch_to.window(driver.window_handles[-1])
time.sleep(3)
# 滚动1000像素
driver.execute_script('window.scrollTo(0,1000)')
time.sleep(3)
driver.find_element(By.LINK_TEXT,'收货地址').click()
driver.find_element(By.XPATH,'//input[@id="people" and @name="consignee"]').send_keys('某某')
time.sleep(3)
province=Select(driver.find_element(By.ID,'province'))
province.select_by_index(1)
city=Select(driver.find_element(By.ID,'city'))
city.select_by_value("52")
time.sleep(1)
district=Select(driver.find_element(By.ID,'district'))
district.select_by_visible_text("昌平区")
time.sleep(3)

















